layui.use(['element','layer'],function () {
    var $ = layui.$;
    var layer = layui.layer;
    var code = $("#code").val();
    var interval = setInterval(function () {
        $.ajax({
            url:'/receipt/isPaid',
            data:{code:code},
            type:'get',
            dataType:'json',
            success:function(rs){
                if(rs.data){
                    clearInterval(interval);
                    layer.msg("支付成功！",function () {
                        location.href = "/receipt";
                    })
                }
            }
        });
    },3000);
});